package com.flxz.forum.service.impl;

import java.util.List;
import com.flxz.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flxz.forum.mapper.ForumReplyMapper;
import com.flxz.forum.domain.ForumReply;
import com.flxz.forum.service.IForumReplyService;

/**
 * 讨论回复Service业务层处理
 * 
 * @author fl
 * @date 2025-09-14
 */
@Service
public class ForumReplyServiceImpl implements IForumReplyService 
{
    @Autowired
    private ForumReplyMapper forumReplyMapper;

    /**
     * 查询讨论回复
     * 
     * @param replyId 讨论回复主键
     * @return 讨论回复
     */
    @Override
    public ForumReply selectForumReplyByReplyId(Long replyId)
    {
        return forumReplyMapper.selectForumReplyByReplyId(replyId);
    }

    /**
     * 查询讨论回复列表
     * 
     * @param forumReply 讨论回复
     * @return 讨论回复
     */
    @Override
    public List<ForumReply> selectForumReplyList(ForumReply forumReply)
    {
        return forumReplyMapper.selectForumReplyList(forumReply);
    }

    /**
     * 新增讨论回复
     * 
     * @param forumReply 讨论回复
     * @return 结果
     */
    @Override
    public int insertForumReply(ForumReply forumReply)
    {
        forumReply.setCreateTime(DateUtils.getNowDate());
        return forumReplyMapper.insertForumReply(forumReply);
    }

    /**
     * 修改讨论回复
     * 
     * @param forumReply 讨论回复
     * @return 结果
     */
    @Override
    public int updateForumReply(ForumReply forumReply)
    {
        forumReply.setUpdateTime(DateUtils.getNowDate());
        return forumReplyMapper.updateForumReply(forumReply);
    }

    /**
     * 批量删除讨论回复
     * 
     * @param replyIds 需要删除的讨论回复主键
     * @return 结果
     */
    @Override
    public int deleteForumReplyByReplyIds(Long[] replyIds)
    {
        return forumReplyMapper.deleteForumReplyByReplyIds(replyIds);
    }

    /**
     * 删除讨论回复信息
     * 
     * @param replyId 讨论回复主键
     * @return 结果
     */
    @Override
    public int deleteForumReplyByReplyId(Long replyId)
    {
        return forumReplyMapper.deleteForumReplyByReplyId(replyId);
    }
}
